import service from "@/utils/service";

// 批量导入汽车站
export const importRepairStoreApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopMain/batch/import",
    method: "post",
    data,
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};
// 批量修改汽修站角色: 用户->汽修站(用户在没有汽修站数据的情况下就已经先注册成用户角色了)
export const allChangeRoleApi = (data: any) => {
  return service({
    url: "/xiechetong/import/update/users/2",
    method: "post",
    data,
    headers: {
      "Content-Type": "multipart/form-data"
    }
  });
};
// 获取所有汽修站
export const getAllRepairStoreList = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopMain/page",
    method: "post",
    data
  });
};
// 编辑汽修站
export const editRepairStoreApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopMain/update",
    method: "post",
    data
  });
};

// 昨天各区县电子健康档案上传情况
export const getRepairIsUploadRInfoApi = () => {
  return service({
    url: "/xiechetong/xctRepairRepairRecord/query-area-upload-record-number",
    method: "get"
  });
};

// 区县管理查询汽修站电子健康档案上传情况
export const getRepairUploadRecordApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairRepairRecord/query-area-upload-record",
    method: "get",
    params: data
  });
};

// 获取汽修店管理员是否解锁小程序
export const getIsLockApi = () => {
  return service({
    url: "/xiechetong/xctRepairShopMain/check-pay-status",
    method: "get"
  });
};

// 获取客户信息
export const getCustomerListApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopCustomers/page",
    method: "post",
    data
  });
};

// 更新客户信息
export const updateCustomerApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopCustomers/update",
    method: "post",
    data
  });
};

//获取车辆列表-不分页
export const getCarListApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopCustomersCar/list",
    method: "post",
    data
  });
};
//获取车辆列表-分页
export const getCarPageApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopCustomersCar/page",
    method: "post",
    data
  });
};
// 编辑车辆信息
export const editCarApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopCustomersCar/update",
    method: "post",
    data
  });
};

// 获取员工列表
export const getEmployeePageApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopEmployee/page",
    method: "post",
    data
  });
};
// 获取员工列表-不分页
export const getEmployeeListApi = () => {
  return service({
    url: "/xiechetong/xctRepairShopEmployee/list",
    method: "post"
  });
};
// 更新员工信息
export const editEmployeeApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopEmployee/update",
    method: "post",
    data
  });
};
// 删除员工
export const deleteEmployeeApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopEmployee/del",
    method: "delete",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};
// 员工邀请码
export const getEmployeeInviteCodeApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopMain/generate-employee-invite-code",
    method: "post",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};
// 员工分配权限
export const setEmployeePermissionApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopEmployee/configuring-role",
    method: "put",
    data
  });
};

// 获取预约订单列表
export const getReserveOrderListApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopReservation/page",
    method: "GET",
    params:data
  });
};

// 添加服务类型
export const addProjectTypeApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProjectCategory/add",
    method: "put",
    data
  });
};

// 获取服务类型列表
export const getProjectTypePageApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProjectCategory/page",
    method: "post",
    data
  });
};
// 获取服务类型列表-不分页
export const getProjectTypeListApi = (data?: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProjectCategory/list",
    method: "post",
    data
  });
};

// 编辑服务类型
export const editProjectTypeApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProjectCategory/update",
    method: "post",
    data
  });
};

// 删除服务类型
export const deleteProjectTypeApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProjectCategory/del",
    method: "delete",
    data,
    headers: {
      "Content-Type": "application/json"
    }
  });
};

// 新增服务项目
export const addServiceProjectApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProject/add",
    method: "put",
    data
  });
};

// 获取服务项目
export const getServiceProjectApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProject/page",
    method: "post",
    data
  });
};

// 编辑服务项目
export const editServiceProjectApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProject/update",
    method: "post",
    data
  });
};

// 删除服务项目
export const deleteServiceProjectApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProject/del",
    method: "delete",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};

// 添加配件类型
export const addServiceTypeApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProductCategory/add",
    method: "put",
    data
  });
};

// 获取配件类型列表-分页
export const getServiceTypePageApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProductCategory/page",
    method: "post",
    data
  });
};
// 获取配件类型列表-不分页
export const getServiceTypeListApi = (data?: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProductCategory/list",
    method: "post",
    data
  });
};

// 编辑配件类型
export const editServiceTypeApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProductCategory/update",
    method: "post",
    data
  });
};

// 删除配件类型
export const deleteServiceTypeApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProductCategory/del",
    method: "delete",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};

// 获取配件列表-分页
export const getPartsPageApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProduct/page",
    method: "post",
    data
  });
};

// 获取配件列表-不分页
export const getPartsListApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProduct/list",
    method: "post",
    data
  });
};

// 新增配件
export const addPartsApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProduct/add",
    method: "put",
    data
  });
};

// 编辑配件
export const editPartsApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProduct/update",
    method: "post",
    data
  });
};

// 删除配件
export const deletePartsApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProduct/del",
    method: "delete",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};

// 获取配件单位列表
export const getPartsUnitPageApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProductUnit/page",
    method: "post",
    data
  });
};
// 获取配件单位列表-不分页
export const getPartsUnitListApi = (data?: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProductUnit/list",
    method: "post",
    data
  });
};

// 添加配件单位
export const addPartsUnitApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProductUnit/add",
    method: "put",
    data
  });
};

// 编辑配件单位
export const editPartsUnitApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProductUnit/update",
    method: "post",
    data
  });
};

// 删除配件单位
export const deletePartsUnitApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopProductUnit/del",
    method: "delete",
    data,
    headers: {
      "Content-Type": "application/x-www-form-urlencoded"
    }
  });
};

// 统计汽修站订单
export const getRepairShopOrderStatisticsApi = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairShopOrder/summary-page",
    method: "post",
    data
  });
};
// 导出

export const exportRepairRepairRecord = (data: any) => {
  return service({
    url: "/xiechetong/xctRepairRepairRecord/export-area-upload-record",
    method: "post",
    responseType: "blob",
    data
  });
};